#pragma once

#include<BWAPI.h>
#include<set>

using namespace BWAPI;

class SpendTask
{
public:
	enum Type{DontSpend , CreateUnit , Research , Upgrade};
	SpendTask()
		:Type(DontSpend),
		BuilderOrResearcher(NULL),
		WhatToCreate(UnitTypes::None),
		WhatToResearch(TechTypes::None),
		WhatToUpgrade(UpgradeTypes::None)
	{
	}
	SpendTask(UnitType type , int whichBase = 0)
		:Type(CreateUnit),
		BuilderOrResearcher(NULL),
		WhatToCreate(type),
		WhatToResearch(TechTypes::None),
		WhatToUpgrade(UpgradeTypes::None)
	{
	}
	SpendTask(TechType type)
		:Type(Research),
		BuilderOrResearcher(NULL),
		WhatToCreate(UnitTypes::None),
		WhatToResearch(type),
		WhatToUpgrade(UpgradeTypes::None)
	{
	}
	SpendTask(UpgradeType type)
		:Type(Upgrade),
		BuilderOrResearcher(NULL),
		WhatToCreate(UnitTypes::None),
		WhatToResearch(TechTypes::None),
		WhatToUpgrade(type)
	{
	}
	static void Initialize()
	{
		SpendTask::AllSpendTasks.push_back(SpendTask());
		SpendTask::AllSpendTasks.push_back(SpendTask(UnitTypes::Zerg_Zergling));
		SpendTask::AllSpendTasks.push_back(SpendTask(UnitTypes::Zerg_Hydralisk));
		SpendTask::AllSpendTasks.push_back(SpendTask(UnitTypes::Zerg_Ultralisk));
		SpendTask::AllSpendTasks.push_back(SpendTask(UnitTypes::Zerg_Drone));
		SpendTask::AllSpendTasks.push_back(SpendTask(UnitTypes::Zerg_Overlord));
		SpendTask::AllSpendTasks.push_back(SpendTask(UnitTypes::Zerg_Mutalisk));
		SpendTask::AllSpendTasks.push_back(SpendTask(UnitTypes::Zerg_Guardian));
		SpendTask::AllSpendTasks.push_back(SpendTask(UnitTypes::Zerg_Queen));
		SpendTask::AllSpendTasks.push_back(SpendTask(UnitTypes::Zerg_Defiler));
		SpendTask::AllSpendTasks.push_back(SpendTask(UnitTypes::Zerg_Scourge));
		SpendTask::AllSpendTasks.push_back(SpendTask(UnitTypes::Zerg_Infested_Terran));
		SpendTask::AllSpendTasks.push_back(SpendTask(UnitTypes::Zerg_Devourer));
		SpendTask::AllSpendTasks.push_back(SpendTask(UnitTypes::Zerg_Lurker));
		SpendTask::AllSpendTasks.push_back(SpendTask(UnitTypes::Zerg_Hatchery));
		SpendTask::AllSpendTasks.push_back(SpendTask(UnitTypes::Zerg_Lair));
		SpendTask::AllSpendTasks.push_back(SpendTask(UnitTypes::Zerg_Hive));
		SpendTask::AllSpendTasks.push_back(SpendTask(UnitTypes::Zerg_Nydus_Canal));
		SpendTask::AllSpendTasks.push_back(SpendTask(UnitTypes::Zerg_Hydralisk_Den));
		SpendTask::AllSpendTasks.push_back(SpendTask(UnitTypes::Zerg_Defiler_Mound));
		SpendTask::AllSpendTasks.push_back(SpendTask(UnitTypes::Zerg_Greater_Spire));
		SpendTask::AllSpendTasks.push_back(SpendTask(UnitTypes::Zerg_Queens_Nest));
		SpendTask::AllSpendTasks.push_back(SpendTask(UnitTypes::Zerg_Evolution_Chamber));
		SpendTask::AllSpendTasks.push_back(SpendTask(UnitTypes::Zerg_Ultralisk_Cavern));
		SpendTask::AllSpendTasks.push_back(SpendTask(UnitTypes::Zerg_Spire));
		SpendTask::AllSpendTasks.push_back(SpendTask(UnitTypes::Zerg_Spawning_Pool));
		SpendTask::AllSpendTasks.push_back(SpendTask(UnitTypes::Zerg_Creep_Colony));
		SpendTask::AllSpendTasks.push_back(SpendTask(UnitTypes::Zerg_Spore_Colony));
		SpendTask::AllSpendTasks.push_back(SpendTask(UnitTypes::Zerg_Sunken_Colony));
		SpendTask::AllSpendTasks.push_back(SpendTask(UnitTypes::Zerg_Extractor));
		/*	SpendTask::AllSpendTasks.push_back(SpendTask(UpgradeTypes::Zerg_Carapace));
		SpendTask::AllSpendTasks.push_back(SpendTask(UpgradeTypes::Zerg_Flyer_Carapace));
		SpendTask::AllSpendTasks.push_back(SpendTask(UpgradeTypes::Zerg_Melee_Attacks));
		SpendTask::AllSpendTasks.push_back(SpendTask(UpgradeTypes::Zerg_Missile_Attacks));
		SpendTask::AllSpendTasks.push_back(SpendTask(UpgradeTypes::Zerg_Flyer_Attacks));
		SpendTask::AllSpendTasks.push_back(SpendTask(UpgradeTypes::Ventral_Sacs));
		SpendTask::AllSpendTasks.push_back(SpendTask(UpgradeTypes::Antennae));
		SpendTask::AllSpendTasks.push_back(SpendTask(UpgradeTypes::Pneumatized_Carapace));
		SpendTask::AllSpendTasks.push_back(SpendTask(UpgradeTypes::Metabolic_Boost));
		SpendTask::AllSpendTasks.push_back(SpendTask(UpgradeTypes::Adrenal_Glands));
		SpendTask::AllSpendTasks.push_back(SpendTask(UpgradeTypes::Muscular_Augments));
		SpendTask::AllSpendTasks.push_back(SpendTask(UpgradeTypes::Grooved_Spines));
		SpendTask::AllSpendTasks.push_back(SpendTask(UpgradeTypes::Gamete_Meiosis));
		SpendTask::AllSpendTasks.push_back(SpendTask(UpgradeTypes::Metasynaptic_Node));
		SpendTask::AllSpendTasks.push_back(SpendTask(UpgradeTypes::Chitinous_Plating));
		SpendTask::AllSpendTasks.push_back(SpendTask(UpgradeTypes::Anabolic_Synthesis));*/

		//----
		SpendTask::MutaSpendTasks.push_back(SpendTask(UnitTypes::Zerg_Spawning_Pool));
		SpendTask::MutaSpendTasks.push_back(SpendTask(UnitTypes::Zerg_Hatchery , 1));
		SpendTask::MutaSpendTasks.push_back(SpendTask(UnitTypes::Zerg_Zergling));
		SpendTask::MutaSpendTasks.push_back(SpendTask(UnitTypes::Zerg_Zergling));
		SpendTask::MutaSpendTasks.push_back(SpendTask(UnitTypes::Zerg_Zergling));
		SpendTask::MutaSpendTasks.push_back(SpendTask(UnitTypes::Zerg_Lair));
		SpendTask::MutaSpendTasks.push_back(SpendTask(UnitTypes::Zerg_Creep_Colony));
		SpendTask::MutaSpendTasks.push_back(SpendTask(UnitTypes::Zerg_Creep_Colony));
		SpendTask::MutaSpendTasks.push_back(SpendTask(UnitTypes::Zerg_Creep_Colony));
		SpendTask::MutaSpendTasks.push_back(SpendTask(UnitTypes::Zerg_Creep_Colony));
	}
	//--
	Type Type;
	Unit* BuilderOrResearcher;
	UnitType WhatToCreate;
	TechType WhatToResearch;
	UpgradeType WhatToUpgrade;
	static vector<SpendTask> AllSpendTasks;
	static vector<SpendTask> MutaSpendTasks;
};
vector<SpendTask> SpendTask::AllSpendTasks;
vector<SpendTask> SpendTask::MutaSpendTasks;